#ifndef _UDPSOCKET_H_
#define _UDPSOCKET_H_

#include <string>
#include "CommonMessages.h"
#include "globals.h"

class UDPSocket
{
public:
	UDPSocket(void);
	UDPSocket(SOCKET s);
	~UDPSocket(void);

	bool RecvUDPData(char* data, int& numOfBytesRead, const std::string& ip_address, int port_num);
	bool SendUDPData(const char* data, int numOfBytes, const std::string& ip_address, int port_num);

	// Server-side Functionalities
	bool SetUpServerAddress(unsigned int &port_num);

private:
	SOCKET mSocket;
	std::string mIPAddress;

	CRITICAL_SECTION mCSLockSend;
	CRITICAL_SECTION mCSLockRecv;

};


#endif
